<?php
/*##################################################

# 模块功能：lywq广告管理插件配置
###################################################*/
error_reporting(0);
header("Content-Type: text/html;charset=utf-8");
if(!@$_SERVER['HTTP_REFERER']) header('location:/');

$info = 'info.ini';
$version = parse_ini_file($info);

if (!file_exists($info)) {
	exit('未检测到info.ini配置文件,请检查 addons/AdManager/info.ini 文件是否存在！');
}
$config = './config/config.php';
if (!file_exists($config)) {
  $configfile = fopen("./config/config.php", "w") or die("Unable to open file!");
  fwrite($configfile, "<?php $"."lywq "."=array ();");
  fclose($configfile);
}
require($config);
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>lywq广告管理插件</title>
    <link href="/static/layui/css/layui.css" rel="stylesheet" type="text/css" />
    <script src="/static/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="/static/js/jquery.js"></script>
	<style>.layui-input-inline textarea{min-width:300px;min-height:150px;}
	.layui-form-item .layui-form-label{min-width:130px;}
	</style>
</head>
<body style="margin:20px 20px">
<style>.showpic {position:absolute; max-width:400px; max-height:500px; text-align:center; line-height:150%; border:2px solid #DEEFFA; padding:5px; background:#FFFFFF;  z-index:99999;}</style>
<div class="showpic" style="display:none;"><img class="showpic_img" width="100%" height="100%"></div>
<form class="layui-form layui-form-pane" action="">
<div class="layui-tab">
  <ul class="layui-tab-title">
    <li class="layui-this">lywq广告管理插件</li>
    <li>赞助支持</li>
    <li>基础设置</li>
    <li>弹窗广告</li>
    <li>全局广告</li>
    <li>详情页广告</li>
    <li>播放页广告</li>
    <li>搜索页广告</li>
    <li>文章页广告</li>
  </ul>
  <div class="layui-tab-content">
    <!-- 介绍页 -->
    <div class="layui-tab-item layui-show">
      <blockquote class="layui-elem-quote layui-quote-nm">
        <p>欢迎使用lywq广告管理插件</p>
        <p><span style="color:red;">注意：</span>本插件为模板辅助插件，请务必在模板中（<span style="color:red;">public / foot.html文件</span>）插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_AdManager.html');{/php}</span></p>
      </blockquote>
      <table class="layui-table">
        <colgroup>
          <col width="100">
            <col width="150">
              <col>
        </colgroup>
        <thead>
          <tr>
            <th colspan="2" scope="col">插件简介</th>
            <th colspan="1" scope="col">使用说明</th></tr>
        </thead>
        <tbody>
          <tr>
            <td>名称</td>
            <td>
              <a href="https://www.muyin.life" target="_blank"><?php echo $version['title'] ;?> <?php echo $version['version'] ;?></a></td>
            <td>1. PHP版本≥5.6</td></tr>
          <tr>
            <td>作者</td>
            <td>
              <a href="<?php echo $version['website'] ;?>" target="_blank"><?php echo $version['author'] ;?></a></td>
            <td>2. 插件均为作者原创开发，不定时更新。</td></tr>
          <tr>
            <td>官方Q群</td>
            <td>
              <a href="https://jq.qq.com/?_wv=1027&k=szDVe4dO" target="_blank">294075802</a></td>
            <td>3. 意见、反馈、功能建议，请加入官方QQ群一起沟通交流！</td></tr>
          <tr>
            <td>作者QQ</td>
            <td>
              <a href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $version['qq'] ;?>&site=qq&menu=yes" target="_blank"><?php echo $version['qq'] ;?></a></td>
            <td>4. 唯一官方QQ，购买非官方制作源码，无任何技术支持及售后服务！</td></tr>
          <tr>
            <td>更新时间</td>
            <td><?php echo $version['updatetime'] ;?></td>
            <td>5. 肆意散播转售或者倒卖，将视为放弃一切技术支持。</td></tr>
          <tr>
            <td style="color:red;">使用教程</td>
            <td>
              <a href="<?php echo $version['tutorial'] ;?>" style="color:blue;" target="_blank">查看教程</a></td>
            <td>6. 使用盗版源码遇到任何问题本人概不负责！</td></tr>
          <tr>
            <td style="color:red;">更新日志</td>
            <td colspan="2" style="color:#2E8B57;">
              <?php echo $version['updatelog'] ;?></td></tr>
          <tr>
            <td colspan="3">请务必尊重知识产权，严格保证不恶意传播产品源码、不得直接对源码进行二次转售或倒卖等。一经发现，我们有权利终止你在我方购买的所有源码的售后技术支持。</td></tr>
        </tbody>
      </table>
    </div>
    
    <!-- 赞助支持 -->
    <div class="layui-tab-item">
      <blockquote class="layui-elem-quote layui-quote-nm">
        <p>您好，首先非常感谢您使用lywq广告管理插件！</p>
        <p>本插件为<span style="color:red;">完全免费</span>插件，目前作者唯一收入为捐赠，免费程序的开发离不开金钱，还请各位多多支持！</p>
        <p></p>
        <p></p>
      </blockquote>
      <!--赞赏二维码-->
      <table class="layui-table">
        <thead>
          <tr>
            <th colspan="3">赞赏部分</th>
        </tr>
        </thead>
        <tbody>
            <tr align="center">
                <td width="20%">微信二维码</td>
                <td width="20%">支付宝二维码</td>
                <td width="60%">话说</td>
            </tr>
            <tr align="center">
                <td width="20%"><a href="https://s3.ax1x.com/2021/02/01/yVBih8.png" target="_blank"><img src="https://s3.ax1x.com/2021/02/01/yVBih8.png" width="auto" /></a></td>
                <td width="20%"><a href="https://s3.ax1x.com/2021/02/01/yVBk9S.jpg" target="_blank"><img src="https://s3.ax1x.com/2021/02/01/yVBk9S.jpg" width="280px" /></a></td>
                <td width="60%">
                <p style="color:#FF0000;">自愿赞赏，不强求，金额随意，一分也是爱！</p>
                <p style="color:#FF8C00;">您的支持将是我最大的动力，加油，奥力给！</p>
                <p><a style="color:	#1E90FF;" href="https://jq.qq.com/?_wv=1027&k=szDVe4dO" target="_blank">点击进群，一起交流插件！</a></p>
                </td>
            </tr>
        </tbody>
      </table>
      <!--广告赞助-->
      <table class="layui-table">
        <thead>
          <tr>
            <th colspan="3">广告部分</th>
        </tr>
        </thead>
        <tbody>
            <tr align="center">
                <td>
                   <iframe src="https://www.muyin.life/ads/lywq_AdManager/lywq_AdManager_ads.html" width="100%" height="320px" frameborder="0" scrolling="yes"></iframe>
                </td>
            </tr>
        </tbody>
      </table>
      <!--友情链接-->
      <table class="layui-table">
        <thead>
          <tr>
            <th colspan="3">友链部分</th>
        </tr>
        </thead>
        <tbody>
            <tr align="center">
                <td>
                   <iframe src="https://www.muyin.life/ads/lywq_AdManager/lywq_AdManager_link.html" width="100%" height="180px" frameborder="0" scrolling="yes"></iframe>
                </td>
            </tr>
        </tbody>
      </table>
    </div>

    <!-- 广告基础设置 -->
    <div class="layui-tab-item">
      <blockquote class="layui-elem-quote layui-quote-nm">
        <p><span style="color:red;">小提示：</span>下方设置对所有广告生效</p>
      </blockquote>
      
        <div class="layui-form-item">
          <label class="layui-form-label">广告状态</label>
          <div class="layui-input-inline">
            <input type="checkbox" name="lywq_AdManager_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['status']?'checked':'';?>>
          </div>
          <div class="layui-form-mid layui-word-aux">关闭后，所有广告均不显示</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">多端显示：</label>
            <div class="layui-input-inline" style="width:500px;">
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_terminal[]" value="pc" title="电脑端" <?php echo strpos($lywq['AdManager']['terminal'],'pc')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_terminal[]" value="android" title="Android端" <?php echo strpos($lywq['AdManager']['terminal'],'android')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_terminal[]" value="ios" title="ios端" <?php echo strpos($lywq['AdManager']['terminal'],'ios')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_terminal[]" value="weixin" title="微信端" <?php echo strpos($lywq['AdManager']['terminal'],'weixin')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_terminal[]" value="qq" title="QQ端" <?php echo strpos($lywq['AdManager']['terminal'],'qq')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_terminal[]" value="bsl" title="变色龙" <?php echo strpos($lywq['AdManager']['terminal'],'bsl')!==false?'checked':'';?> >
            </div>
            <div class="layui-form-mid layui-word-aux">勾选需要显示的终端</div>
        </div>
        <!--分端展示-指定端选择-->
        <div class="layui-form-item">
           <label class="layui-form-label">指定端选择：</label>
           <div class="layui-input-inline" style="width:500px;">
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_Zterminal[]" value="pc" title="电脑端" <?php echo strpos($lywq['AdManager']['Zterminal'],'pc')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_Zterminal[]" value="android" title="Android端" <?php echo strpos($lywq['AdManager']['Zterminal'],'android')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_Zterminal[]" value="ios" title="ios端" <?php echo strpos($lywq['AdManager']['Zterminal'],'ios')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_Zterminal[]" value="weixin" title="微信端" <?php echo strpos($lywq['AdManager']['Zterminal'],'weixin')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_Zterminal[]" value="qq" title="QQ端" <?php echo strpos($lywq['AdManager']['Zterminal'],'qq')!==false?'checked':'';?> >
                <input type="checkbox" lay-skin="primary" name="lywq_AdManager_Zterminal[]" value="bsl" title="变色龙" <?php echo strpos($lywq['AdManager']['Zterminal'],'bsl')!==false?'checked':'';?> >
            </div>
            <div class="layui-form-mid layui-word-aux">选择指定端显示指定广告，用于根据不同客户端显示不同广告</div>
        </div>
        
        <!-- 保存 -->
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button></div>
        </div>
    </div>
    
    <!--弹窗广告设置-->
    <div class="layui-tab-item">
      <!--<blockquote class="layui-elem-quote layui-quote-nm">-->
      <!--  <p><span style="color:red;">注意：</span>广告弹窗，请在模板中（<span style="color:red;">public / foot.html文件</span>）插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_AdManager.html');{/php}</span></p>-->
      <!--</blockquote>-->
		<div class="layui-form-item">
			<label class="layui-form-label">广告状态：</label>
			<div class="layui-input-inline">
	            <input type="checkbox" name="lywq_AdManager_pupop_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['pupop']['status']?'checked':'';?>>
			</div>
        	<div class="layui-form-mid layui-word-aux">首次进入网站弹出的广告</div>
		</div>
		
		<div class="layui-form-item">
           <label class="layui-form-label">弹窗间隔类型：</label>
           <div class="layui-input-block">
             <input type="radio" name="lywq_AdManager_interval_type" value="0" title="关闭" <?php echo $lywq['AdManager']['interval']['type']==0?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_interval_type" value="1" title="间隔弹出" <?php echo $lywq['AdManager']['interval']['type']==1?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_interval_type" value="2" title="次数弹出" <?php echo $lywq['AdManager']['interval']['type']==2?'checked':'';?>>
           </div>
           <div class="layui-form-mid layui-word-aux">关闭后，默认刷新页面就弹出</div>
        </div>
        <div class="layui-form-item" <?php if ($lywq['AdManager']['interval']['type'] != 1) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">间隔时间：</label>
           <div class="layui-input-inline">
              <input type="text" name="lywq_AdManager_interval_time" placeholder="填写间隔时间" value="<?php echo $lywq['AdManager']['interval']['time'];?>" autocomplete="off" class="layui-input">
           </div>
           <div class="layui-form-mid layui-word-aux">单位：分钟</div>
        </div>
        <div class="layui-form-item" <?php if ($lywq['AdManager']['interval']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">弹出次数：</label>
           <div class="layui-input-inline">
              <input type="text" name="lywq_AdManager_interval_number" placeholder="填写弹出次数" value="<?php echo $lywq['AdManager']['interval']['number'];?>" autocomplete="off" class="layui-input">
           </div>
           <div class="layui-form-mid layui-word-aux">每天弹出次数</div>
        </div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">广告轮播：</label>
			<div class="layui-input-inline">
	            <input type="checkbox" name="lywq_AdManager_pupop_carousel" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['pupop']['carousel']?'checked':'';?>>
			</div>
        	<div class="layui-form-mid layui-word-aux">轮播显示广告</div>
		</div>
		
		<div class="layui-form-item">
           <label class="layui-form-label">广告类型：</label>
           <div class="layui-input-block">
             <input type="radio" name="lywq_AdManager_pupop_type" value="1" title="广告代码" <?php echo $lywq['AdManager']['pupop']['type']==1?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_pupop_type" value="2" title="自定义广告" <?php echo $lywq['AdManager']['pupop']['type']==2?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_pupop_type" value="3" title="分端展示" <?php echo $lywq['AdManager']['pupop']['type']==3?'checked':'';?>>
           </div>
           <div class="layui-form-mid layui-word-aux">选择后请点击一下保存</div>
        </div>
        <!--广告代码-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['pupop']['type'] != 1) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">广告代码：</label>
           <div class="layui-input-inline w300">
           	<textarea name="lywq_AdManager_pupop_code1" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['pupop']['code1'];?></textarea>
           </div>
           <div class="layui-input-inline w300" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
           	<textarea name="lywq_AdManager_pupop_code2" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['pupop']['code2'];?></textarea>
           </div>
           <div class="layui-input-inline w300" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
           	<textarea name="lywq_AdManager_pupop_code3" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['pupop']['code3'];?></textarea>
           </div>
        </div>
        <!--广告图片-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['pupop']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">广告图片：</label>
           <div class="layui-input-inline">
             <input type="text" name="lywq_AdManager_pupop_image1" placeholder="请填写弹窗图片地址" value="<?php echo $lywq['AdManager']['pupop']['image1'];?>" autocomplete="off" class="layui-input upload-input upload-img">
           </div>
           <!--<div class="layui-input-inline" style="width:100px;">-->
           <!--  <span class="layui-btn layui-upload">上传图片</span>-->
           <!--</div>-->
           <div class="layui-input-inline" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
              <input type="text" name="lywq_AdManager_pupop_image2" placeholder="请填写弹窗图片地址" value="<?php echo $lywq['AdManager']['pupop']['image2'];?>" autocomplete="off" class="layui-input upload-input upload-img">
           </div>
           <!--<div class="layui-input-inline" style="width:100px;">-->
           <!--  <span class="layui-btn layui-upload">上传图片</span>-->
           <!--</div>-->
           <div class="layui-input-inline" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
              <input type="text" name="lywq_AdManager_pupop_image3" placeholder="请填写弹窗图片地址" value="<?php echo $lywq['AdManager']['pupop']['image3'];?>" autocomplete="off" class="layui-input upload-input upload-img">
           </div>
           <!--<div class="layui-input-inline" style="width:100px;">-->
           <!--  <span class="layui-btn layui-upload">上传图片</span>-->
           <!--</div>-->
        </div>
        <!--广告地址-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['pupop']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">跳转链接：</label>
           <div class="layui-input-inline">
              <input type="text" name="lywq_AdManager_pupop_url1" placeholder="请填写跳转地址" value="<?php echo $lywq['AdManager']['pupop']['url1'];?>" autocomplete="off" class="layui-input">
           </div>
           <div class="layui-input-inline" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
              <input type="text" name="lywq_AdManager_pupop_url2" placeholder="请填写跳转地址" value="<?php echo $lywq['AdManager']['pupop']['url2'];?>" autocomplete="off" class="layui-input">
           </div>
           <div class="layui-input-inline" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
              <input type="text" name="lywq_AdManager_pupop_url3" placeholder="请填写跳转地址" value="<?php echo $lywq['AdManager']['pupop']['url3'];?>" autocomplete="off" class="layui-input">
           </div>
        </div>
        <!--分端展示-指定端-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['pupop']['type'] != 3) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">指定端广告代码：</label>
           <div class="layui-input-inline w300">
           	<textarea name="lywq_AdManager_pupop_Zcode1" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['pupop']['Zcode1'];?></textarea>
           </div>
           <div class="layui-input-inline w300" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
           	<textarea name="lywq_AdManager_pupop_Zcode2" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['pupop']['Zcode2'];?></textarea>
           </div>
           <div class="layui-input-inline w300" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
           	<textarea name="lywq_AdManager_pupop_Zcode3" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['pupop']['Zcode3'];?></textarea>
           </div>
        </div>
        <!--分端展示-其他端-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['pupop']['type'] != 3) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">其他端广告代码：</label>
           <div class="layui-input-inline w300">
           	<textarea name="lywq_AdManager_pupop_Qcode1" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['pupop']['Qcode1'];?></textarea>
           </div>
           <div class="layui-input-inline w300" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
           	<textarea name="lywq_AdManager_pupop_Qcode2" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['pupop']['Qcode2'];?></textarea>
           </div>
           <div class="layui-input-inline w300" <?php if ($lywq['AdManager']['pupop']['carousel'] == 0) { echo 'style="display:none;"';} ?> >
           	<textarea name="lywq_AdManager_pupop_Qcode3" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['pupop']['Qcode3'];?></textarea>
           </div>
        </div>
		
		<div class="layui-form-item">
           <label class="layui-form-label">关闭方式：</label>
           <div class="layui-input-block">
             <input type="radio" name="lywq_AdManager_closepupop_type" value="0" title="隐藏关闭功能" <?php echo $lywq['AdManager']['closepupop']['type']==0?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_closepupop_type" value="1" title="按钮关闭" <?php echo $lywq['AdManager']['closepupop']['type']==1?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_closepupop_type" value="2" title="图片关闭" <?php echo $lywq['AdManager']['closepupop']['type']==2?'checked':'';?>>
           </div>
           <div class="layui-form-mid layui-word-aux">隐藏关闭功能：配合弹窗间隔类型使用，即点击广告后关闭广告弹窗</div>
        </div>
        <div class="layui-form-item" <?php if ($lywq['AdManager']['closepupop']['type'] != 1) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">关闭按钮名称：</label>
           <div class="layui-input-inline">
              <input type="text" name="lywq_AdManager_closepupop_button" placeholder="请填写按钮名称" value="<?php echo $lywq['AdManager']['closepupop']['button'];?>" autocomplete="off" class="layui-input">
           </div>
        </div>
        <div class="layui-form-item" <?php if ($lywq['AdManager']['closepupop']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">关闭引导图：</label>
          <div class="layui-input-inline">
        	<input type="text" name="lywq_AdManager_closepupop_image" placeholder="请填写关闭引导图地址" value="<?php echo $lywq['AdManager']['closepupop']['image'];?>" autocomplete="off" class="layui-input upload-input upload-img">
          </div>
          <div class="layui-input-inline" style="width:100px;">
            <span class="layui-btn layui-upload">上传图片</span>
          </div>
        </div>

        <!-- 保存 -->
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button></div>
        </div>
    </div>
    
    <!--全局广告设置-->
    <div class="layui-tab-item">
      <blockquote class="layui-elem-quote layui-quote-nm">
        <p><span style="color:red;">注意：</span>本插件为模板辅助插件，引入代码插入位置具体根据自己的模板进行调整。</p>
      </blockquote>
      
	  <label class="layui-form-label">漂浮广告</label>
      <blockquote class="layui-elem-quote layui-quote-nm">
	    <div class="layui-form-item">
        	<p><span style="color:red;">注意：</span>全局漂浮广告，请在模板中（<span style="color:red;">public / foot.html文件</span>）插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_ads_all.html');{/php}</span></p>
        </div>
	    <div class="layui-form-item">
	      <label class="layui-form-label">广告状态</label>
	      <div class="layui-input-inline">
	        <input type="checkbox" name="lywq_AdManager_all_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['all']['status']?'checked':'';?>>
	      </div>
	      <div class="layui-form-mid layui-word-aux">关闭后，全局漂浮广告不显示</div>
	    </div>
	    <!--广告代码-->
	    <div class="layui-form-item">
	       <label class="layui-form-label">广告代码：</label>
	       <div class="layui-input-inline w300">
	       	<textarea name="lywq_AdManager_all_code" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['all']['code'];?></textarea>
	       </div>
	    </div>

     <!-- 保存 -->
     <div class="layui-form-item">
    	<div class="layui-input-block">
        	<button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button>
    	</div>
     </div>
      </blockquote>
     
    </div>
    
    <!--详情页广告设置-->
    <div class="layui-tab-item">
      <blockquote class="layui-elem-quote layui-quote-nm">
        <p><span style="color:red;">注意：</span>本插件为模板辅助插件，引入代码插入位置具体根据自己的模板进行调整。<span style="color:red;">漂浮和内嵌引入代码不同，请看仔细，选择插入。</span></p>
      </blockquote>
      
	  <label class="layui-form-label">漂浮广告</label>
      <blockquote class="layui-elem-quote layui-quote-nm">
	    <div class="layui-form-item">
        	<p><span style="color:red;">注意：</span>详情页漂浮广告，请在模板中（<span style="color:red;">vod / detail.html文件</span>）最后插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_ads_detailF.html');{/php}</span></p>
        </div>
	    <div class="layui-form-item">
	      <label class="layui-form-label">广告状态</label>
	      <div class="layui-input-inline">
	        <input type="checkbox" name="lywq_AdManager_detailF_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['detailF']['status']?'checked':'';?>>
	      </div>
	      <div class="layui-form-mid layui-word-aux">关闭后，详情页漂浮广告不显示</div>
	    </div>
	    <!--广告代码-->
	    <div class="layui-form-item">
	       <label class="layui-form-label">广告代码：</label>
	       <div class="layui-input-inline w300">
	       	<textarea name="lywq_AdManager_detailF_code" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['detailF']['code'];?></textarea>
	       </div>
	    </div>

	     <!-- 保存 -->
	     <div class="layui-form-item">
	    	<div class="layui-input-block">
	        	<button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button>
	    	</div>
	     </div>
      </blockquote>

	  <label class="layui-form-label">内嵌广告</label>
      <blockquote class="layui-elem-quote layui-quote-nm">
	    <div class="layui-form-item">
        	<p><span style="color:red;">注意：</span>详情页内嵌广告，请在模板中（<span style="color:red;">vod / detail.html文件</span>）需要展示的位置插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_ads_detail.html');{/php}</span></p>
        </div>   
		<div class="layui-form-item">
	      <label class="layui-form-label">广告状态</label>
	      <div class="layui-input-inline">
	        <input type="checkbox" name="lywq_AdManager_detail_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['detail']['status']?'checked':'';?>>
	      </div>
	      <div class="layui-form-mid layui-word-aux">关闭后，详情页内嵌广告不显示</div>
	    </div>
		<div class="layui-form-item">
	       <label class="layui-form-label">广告类型：</label>
	       <div class="layui-input-block">
	         <input type="radio" name="lywq_AdManager_detail_type" value="1" title="广告代码" <?php echo $lywq['AdManager']['detail']['type']==1?'checked':'';?>>
	         <input type="radio" name="lywq_AdManager_detail_type" value="2" title="自定义广告" <?php echo $lywq['AdManager']['detail']['type']==2?'checked':'';?>>
	         <input type="radio" name="lywq_AdManager_detail_type" value="3" title="分端展示" <?php echo $lywq['AdManager']['detail']['type']==3?'checked':'';?>>
	       </div>
           <div class="layui-form-mid layui-word-aux">选择后请点击一下保存</div>
	    </div>
	    <!--广告代码-->
	    <div class="layui-form-item" <?php if ($lywq['AdManager']['detail']['type'] != 1) { echo 'style="display:none;"';} ?> >
	       <label class="layui-form-label">广告代码：</label>
	       <div class="layui-input-inline w300">
	       	<textarea name="lywq_AdManager_detail_code" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['detail']['code'];?></textarea>
	       </div>
	    </div>
	    <!--广告图片-->
	    <div class="layui-form-item" <?php if ($lywq['AdManager']['detail']['type'] != 2) { echo 'style="display:none;"';} ?> >
	       <label class="layui-form-label">广告图片：</label>
	       <div class="layui-input-inline">
	         <input type="text" name="lywq_AdManager_detail_image" placeholder="请填写弹窗图片地址" value="<?php echo $lywq['AdManager']['detail']['image'];?>" autocomplete="off" class="layui-input upload-input upload-img">
	       </div>
          <div class="layui-input-inline" style="width:100px;">
            <span class="layui-btn layui-upload">上传图片</span>
          </div>
	    </div>
	    <!--广告地址-->
	    <div class="layui-form-item" <?php if ($lywq['AdManager']['detail']['type'] != 2) { echo 'style="display:none;"';} ?> >
	       <label class="layui-form-label">跳转链接：</label>
	       <div class="layui-input-inline">
	          <input type="text" name="lywq_AdManager_detail_url" placeholder="请填写跳转地址" value="<?php echo $lywq['AdManager']['detail']['url'];?>" autocomplete="off" class="layui-input">
	       </div>
      </div>
      <!--分端展示-指定端-->
      <div class="layui-form-item" <?php if ($lywq['AdManager']['detail']['type'] != 3) { echo 'style="display:none;"';} ?> >
          <label class="layui-form-label">指定端广告代码：</label>
          <div class="layui-input-inline w300">
          <textarea name="lywq_AdManager_detail_Zcode" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['detail']['Zcode'];?></textarea>
          </div>
      </div>
      <!--分端展示-其他端-->
      <div class="layui-form-item" <?php if ($lywq['AdManager']['detail']['type'] != 3) { echo 'style="display:none;"';} ?> >
          <label class="layui-form-label">其他端广告代码：</label>
          <div class="layui-input-inline w300">
          <textarea name="lywq_AdManager_detail_Qcode" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['detail']['Qcode'];?></textarea>
          </div>
      </div>
	    <!-- 保存 -->
	    <div class="layui-form-item">
	      <div class="layui-input-block">
	        <button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button></div>
	    </div>
      </blockquote>	    
    </div>
    
    <!--播放页广告设置-->
    <div class="layui-tab-item">
      <blockquote class="layui-elem-quote layui-quote-nm">
        <p><span style="color:red;">注意：</span>本插件为模板辅助插件，引入代码插入位置具体根据自己的模板进行调整。<span style="color:red;">漂浮和内嵌引入代码不同，请看仔细，选择插入。</span></p>
      </blockquote>
      
	  <label class="layui-form-label">漂浮广告</label>
      <blockquote class="layui-elem-quote layui-quote-nm">
	    <div class="layui-form-item">
        	<p><span style="color:red;">注意：</span>播放页漂浮广告，请在模板中（<span style="color:red;">vod / play.html文件</span>）最后插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_ads_playF.html');{/php}</span></p>
        </div>
	    <div class="layui-form-item">
	      <label class="layui-form-label">广告状态</label>
	      <div class="layui-input-inline">
	        <input type="checkbox" name="lywq_AdManager_playF_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['playF']['status']?'checked':'';?>>
	      </div>
	      <div class="layui-form-mid layui-word-aux">关闭后，播放页漂浮广告不显示</div>
	    </div>
	    <!--广告代码-->
	    <div class="layui-form-item">
	       <label class="layui-form-label">广告代码：</label>
	       <div class="layui-input-inline w300">
	       	<textarea name="lywq_AdManager_playF_code" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['playF']['code'];?></textarea>
	       </div>
	    </div>

	     <!-- 保存 -->
	     <div class="layui-form-item">
	    	<div class="layui-input-block">
	        	<button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button>
	    	</div>
	     </div>
      </blockquote>

	  <label class="layui-form-label">内嵌广告</label>
      <blockquote class="layui-elem-quote layui-quote-nm">
	    <div class="layui-form-item">
        	<p><span style="color:red;">注意：</span>播放页内嵌广告，请在模板中（<span style="color:red;">vod / play.html文件</span>）需要展示的位置插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_ads_play.html');{/php}</span></p>
        </div>
		<div class="layui-form-item">
          <label class="layui-form-label">广告状态</label>
          <div class="layui-input-inline">
            <input type="checkbox" name="lywq_AdManager_play_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['play']['status']?'checked':'';?>>
          </div>
           <div class="layui-form-mid layui-word-aux">关闭后，播放页内嵌广告不显示</div>
        </div>
		<div class="layui-form-item">
           <label class="layui-form-label">广告类型：</label>
           <div class="layui-input-block">
             <input type="radio" name="lywq_AdManager_play_type" value="1" title="广告代码" <?php echo $lywq['AdManager']['play']['type']==1?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_play_type" value="2" title="自定义广告" <?php echo $lywq['AdManager']['play']['type']==2?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_play_type" value="3" title="分端展示" <?php echo $lywq['AdManager']['play']['type']==3?'checked':'';?>>
           </div>
           <div class="layui-form-mid layui-word-aux">选择后请点击一下保存</div>
        </div>
        <!--广告代码-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['play']['type'] != 1) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">广告代码：</label>
           <div class="layui-input-inline w300">
           	<textarea name="lywq_AdManager_play_code" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['play']['code'];?></textarea>
           </div>
        </div>
        <!--广告图片-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['play']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">广告图片：</label>
           <div class="layui-input-inline">
             <input type="text" name="lywq_AdManager_play_image" placeholder="请填写弹窗图片地址" value="<?php echo $lywq['AdManager']['play']['image'];?>" autocomplete="off" class="layui-input upload-input upload-img">
           </div>
          <div class="layui-input-inline" style="width:100px;">
            <span class="layui-btn layui-upload">上传图片</span>
          </div>
        </div>
        <!--广告地址-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['play']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">跳转链接：</label>
           <div class="layui-input-inline">
              <input type="text" name="lywq_AdManager_play_url" placeholder="请填写跳转地址" value="<?php echo $lywq['AdManager']['play']['url'];?>" autocomplete="off" class="layui-input">
           </div>
        </div>
        <!--分端展示-指定端-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['play']['type'] != 3) { echo 'style="display:none;"';} ?> >
            <label class="layui-form-label">指定端广告代码：</label>
            <div class="layui-input-inline w300">
            <textarea name="lywq_AdManager_play_Zcode" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['play']['Zcode'];?></textarea>
            </div>
        </div>
        <!--分端展示-其他端-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['play']['type'] != 3) { echo 'style="display:none;"';} ?> >
            <label class="layui-form-label">其他端广告代码：</label>
            <div class="layui-input-inline w300">
            <textarea name="lywq_AdManager_play_Qcode" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['play']['Qcode'];?></textarea>
            </div>
        </div>
        <!-- 保存 -->
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button></div>
        </div>
      </blockquote>
    </div>
    
    <!--搜索页广告设置-->
    <div class="layui-tab-item">
      <blockquote class="layui-elem-quote layui-quote-nm">
        <p><span style="color:red;">注意：</span>本插件为模板辅助插件，引入代码插入位置具体根据自己的模板进行调整。<span style="color:red;">漂浮和内嵌引入代码不同，请看仔细，选择插入。</span></p>
      </blockquote>
      
	  <label class="layui-form-label">漂浮广告</label>
      <blockquote class="layui-elem-quote layui-quote-nm">
	    <div class="layui-form-item">
        	<p><span style="color:red;">注意：</span>搜索页漂浮广告，请在模板中（<span style="color:red;">vod / search.html文件</span>）最后插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_ads_searchF.html');{/php}</span></p>
        </div>
	    <div class="layui-form-item">
	      <label class="layui-form-label">广告状态</label>
	      <div class="layui-input-inline">
	        <input type="checkbox" name="lywq_AdManager_searchF_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['searchF']['status']?'checked':'';?>>
	      </div>
	      <div class="layui-form-mid layui-word-aux">关闭后，搜索页漂浮广告不显示</div>
	    </div>
	    <!--广告代码-->
	    <div class="layui-form-item">
	       <label class="layui-form-label">广告代码：</label>
	       <div class="layui-input-inline w300">
	       	<textarea name="lywq_AdManager_searchF_code" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['searchF']['code'];?></textarea>
	       </div>
	    </div>
	    <!-- 保存 -->
	    <div class="layui-form-item">
	    	<div class="layui-input-block">
	        	<button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button>
	    	</div>
	     </div>
      </blockquote>      

	  <label class="layui-form-label">内嵌广告</label>
      <blockquote class="layui-elem-quote layui-quote-nm">
	    <div class="layui-form-item">
        	<p><span style="color:red;">注意：</span>搜索页内嵌广告，请在模板中（<span style="color:red;">vod / search.html文件</span>）需要展示的位置插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_ads_search.html');{/php}</span></p>
        </div>
		<div class="layui-form-item">
          <label class="layui-form-label">广告状态</label>
          <div class="layui-input-inline">
            <input type="checkbox" name="lywq_AdManager_search_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['search']['status']?'checked':'';?>>
          </div>
          <div class="layui-form-mid layui-word-aux">关闭后，搜索页内嵌广告不显示</div>
        </div>
		<div class="layui-form-item">
           <label class="layui-form-label">广告类型：</label>
           <div class="layui-input-block">
             <input type="radio" name="lywq_AdManager_search_type" value="1" title="广告代码" <?php echo $lywq['AdManager']['search']['type']==1?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_search_type" value="2" title="自定义广告" <?php echo $lywq['AdManager']['search']['type']==2?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_search_type" value="3" title="分端展示" <?php echo $lywq['AdManager']['search']['type']==3?'checked':'';?>>
           </div>
           <div class="layui-form-mid layui-word-aux">选择后请点击一下保存</div>
        </div>
        <!--广告代码-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['search']['type'] != 1) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">广告代码：</label>
           <div class="layui-input-inline w300">
           	<textarea name="lywq_AdManager_search_code" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['search']['code'];?></textarea>
           </div>
        </div>
        <!--广告图片-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['search']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">广告图片：</label>
           <div class="layui-input-inline">
             <input type="text" name="lywq_AdManager_search_image" placeholder="请填写弹窗图片地址" value="<?php echo $lywq['AdManager']['search']['image'];?>" autocomplete="off" class="layui-input upload-input upload-img">
           </div>
          <div class="layui-input-inline" style="width:100px;">
            <span class="layui-btn layui-upload">上传图片</span>
          </div>
        </div>
        <!--广告地址-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['search']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">跳转链接：</label>
           <div class="layui-input-inline">
              <input type="text" name="lywq_AdManager_search_url" placeholder="请填写跳转地址" value="<?php echo $lywq['AdManager']['search']['url'];?>" autocomplete="off" class="layui-input">
           </div>
        </div>
        <!--分端展示-指定端-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['search']['type'] != 3) { echo 'style="display:none;"';} ?> >
            <label class="layui-form-label">指定端广告代码：</label>
            <div class="layui-input-inline w300">
            <textarea name="lywq_AdManager_search_Zcode" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['search']['Zcode'];?></textarea>
            </div>
        </div>
        <!--分端展示-其他端-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['search']['type'] != 3) { echo 'style="display:none;"';} ?> >
            <label class="layui-form-label">其他端广告代码：</label>
            <div class="layui-input-inline w300">
            <textarea name="lywq_AdManager_search_Qcode" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['search']['Qcode'];?></textarea>
            </div>
        </div>
        <!-- 保存 -->
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button></div>
        </div>
      </blockquote>
    </div>
    
    <!--文章页广告设置-->
    <div class="layui-tab-item">
      <blockquote class="layui-elem-quote layui-quote-nm">
        <p><span style="color:red;">注意：</span>本插件为模板辅助插件，引入代码插入位置具体根据自己的模板进行调整。<span style="color:red;">漂浮和内嵌引入代码不同，请看仔细，选择插入。</span></p>
      </blockquote>
      
	  <label class="layui-form-label">漂浮广告</label>
      <blockquote class="layui-elem-quote layui-quote-nm">
	    <div class="layui-form-item">
        	<p><span style="color:red;">注意：</span>文章页漂浮广告，请在模板中（<span style="color:red;">art / detail.html文件</span>）最后插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_ads_articleF.html');{/php}</span></p>
        </div>
	    <div class="layui-form-item">
	      <label class="layui-form-label">广告状态</label>
	      <div class="layui-input-inline">
	        <input type="checkbox" name="lywq_AdManager_articleF_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['articleF']['status']?'checked':'';?>>
	      </div>
	      <div class="layui-form-mid layui-word-aux">关闭后，文章页漂浮广告不显示</div>
	    </div>
	    <!--广告代码-->
	    <div class="layui-form-item">
	       <label class="layui-form-label">广告代码：</label>
	       <div class="layui-input-inline w300">
	       	<textarea name="lywq_AdManager_articleF_code" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['articleF']['code'];?></textarea>
	       </div>
	    </div>

	     <!-- 保存 -->
	     <div class="layui-form-item">
	    	<div class="layui-input-block">
	        	<button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button>
	    	</div>
	     </div>
      </blockquote>      

	  <label class="layui-form-label">内嵌广告</label>
      <blockquote class="layui-elem-quote layui-quote-nm">
	    <div class="layui-form-item">
        	<p><span style="color:red;">注意：</span>文章页内嵌广告，请在模板中（<span style="color:red;">art / detail.html文件</span>）需要展示的位置插入如下代码：<span style="font-weight:bold;color:green;">{php}require('./addons/AdManager/html/lywq_ads_article.html');{/php}</span></p>
        </div>
		<div class="layui-form-item">
          <label class="layui-form-label">广告状态</label>
          <div class="layui-input-inline">
            <input type="checkbox" name="lywq_AdManager_article_status" lay-skin="switch" lay-text="开启|关闭" value="1" <?php echo $lywq['AdManager']['article']['status']?'checked':'';?>>
          </div>
          <div class="layui-form-mid layui-word-aux">关闭后，文章页内嵌广告不显示</div>
        </div>
		<div class="layui-form-item">
           <label class="layui-form-label">广告类型：</label>
           <div class="layui-input-block">
             <input type="radio" name="lywq_AdManager_article_type" value="1" title="广告代码" <?php echo $lywq['AdManager']['article']['type']==1?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_article_type" value="2" title="自定义广告" <?php echo $lywq['AdManager']['article']['type']==2?'checked':'';?>>
             <input type="radio" name="lywq_AdManager_article_type" value="3" title="分端展示" <?php echo $lywq['AdManager']['article']['type']==3?'checked':'';?>>
           </div>
           <div class="layui-form-mid layui-word-aux">选择后请点击一下保存</div>
        </div>
        <!--广告代码-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['article']['type'] != 1) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">广告代码：</label>
           <div class="layui-input-inline w300">
           	<textarea name="lywq_AdManager_article_code" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['article']['code'];?></textarea>
           </div>
        </div>
        <!--广告图片-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['article']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">广告图片：</label>
           <div class="layui-input-inline">
             <input type="text" name="lywq_AdManager_article_image" placeholder="请填写弹窗图片地址" value="<?php echo $lywq['AdManager']['article']['image'];?>" autocomplete="off" class="layui-input upload-input upload-img">
           </div>
          <div class="layui-input-inline" style="width:100px;">
            <span class="layui-btn layui-upload">上传图片</span>
          </div>
        </div>
        <!--广告地址-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['article']['type'] != 2) { echo 'style="display:none;"';} ?> >
           <label class="layui-form-label">跳转链接：</label>
           <div class="layui-input-inline">
              <input type="text" name="lywq_AdManager_article_url" placeholder="请填写跳转地址" value="<?php echo $lywq['AdManager']['article']['url'];?>" autocomplete="off" class="layui-input">
           </div>
        </div>
        <!--分端展示-指定端-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['article']['type'] != 3) { echo 'style="display:none;"';} ?> >
            <label class="layui-form-label">指定端广告代码：</label>
            <div class="layui-input-inline w300">
            <textarea name="lywq_AdManager_article_Zcode" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['article']['Zcode'];?></textarea>
            </div>
        </div>
        <!--分端展示-其他端-->
        <div class="layui-form-item" <?php if ($lywq['AdManager']['article']['type'] != 3) { echo 'style="display:none;"';} ?> >
            <label class="layui-form-label">其他端广告代码：</label>
            <div class="layui-input-inline w300">
            <textarea name="lywq_AdManager_article_Qcode" class="layui-textarea"  placeholder="请输入广告代码"><?php echo $lywq['AdManager']['article']['Qcode'];?></textarea>
            </div>
        </div>
        <!-- 保存 -->
        <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="systemsave">保存配置</button></div>
        </div>
      </blockquote>
    </div>
    
  </div>
</div>
</form>


<script>
layui.use(['layer', 'form', 'table', 'upload', 'element'], function(){
  var layer = layui.layer 
  ,form = layui.form
  ,table = layui.table 
  ,upload = layui.upload
  ,element = layui.element 
  var upload_path = $('.j-ajax', parent.document).attr('href').replace('/index/clear.html', '') + '/upload/upload.html?flag=addon';
  var ishttps = 'https:' == document.location.protocol ? 'https://': 'http://';
        upload.render({
            elem: '.layui-upload'
            ,url: upload_path
            ,method: 'post'
            ,before: function(input) {
                layer.msg('文件上传中...', {time:3000000});
            },done: function(res, index, upload) {
                var obj = this.item;
                if (res.code == 0) {
                    layer.msg(res.msg);
                    return false;
                }
                layer.closeAll();
                var input = $(obj).parent().parent().find('.upload-input');
                if ($(obj).attr('lay-type') == 'image') {
                    input.siblings('img').attr('src', res.data.file).show();
                }
                input.val(ishttps+window.location.host+'/'+res.data.file);
            }
        });


  form.on('submit(systemsave)', function(data){
    console.log(JSON.stringify(data.field));
    data.field.lywq_AdManager_status = data.field.lywq_AdManager_status?data.field.lywq_AdManager_status:'0';
    data.field.lywq_AdManager_interval_type = data.field.lywq_AdManager_interval_type?data.field.lywq_AdManager_interval_type:'1';
    data.field.lywq_AdManager_interval_number = data.field.lywq_AdManager_interval_number?data.field.lywq_AdManager_interval_number:'3';
    data.field.lywq_AdManager_pupop_carousel = data.field.lywq_AdManager_pupop_carousel?data.field.lywq_AdManager_pupop_carousel:'0';
    data.field.lywq_AdManager_pupop_type = data.field.lywq_AdManager_pupop_type?data.field.lywq_AdManager_pupop_type:'1';
    data.field.lywq_AdManager_closepupop_type = data.field.lywq_AdManager_closepupop_type?data.field.lywq_AdManager_closepupop_type:'1';
    
    
    data.field.lywq_AdManager_all_status = data.field.lywq_AdManager_all_status?data.field.lywq_AdManager_all_status:'0';
    data.field.lywq_AdManager_detail_status = data.field.lywq_AdManager_detail_status?data.field.lywq_AdManager_detail_status:'0';
    data.field.lywq_AdManager_detailF_status = data.field.lywq_AdManager_detailF_status?data.field.lywq_AdManager_detailF_status:'0';
    data.field.lywq_AdManager_play_status = data.field.lywq_AdManager_play_status?data.field.lywq_AdManager_play_status:'0';
    data.field.lywq_AdManager_playF_status = data.field.lywq_AdManager_playF_status?data.field.lywq_AdManager_playF_status:'0';
    data.field.lywq_AdManager_search_status = data.field.lywq_AdManager_search_status?data.field.lywq_AdManager_search_status:'0';
    data.field.lywq_AdManager_searchF_status = data.field.lywq_AdManager_searchF_status?data.field.lywq_AdManager_searchF_status:'0';
    data.field.lywq_AdManager_article_status = data.field.lywq_AdManager_article_status?data.field.lywq_AdManager_article_status:'0';
    data.field.lywq_AdManager_articleF_status = data.field.lywq_AdManager_articleF_status?data.field.lywq_AdManager_articleF_status:'0';
    
    data.field.lywq_AdManager_pupop_status = data.field.lywq_AdManager_pupop_status?data.field.lywq_AdManager_pupop_status:'0';
    
    
    $.ajax({
        url: "save.php",
        data: data.field,
        type: "post", 
		dataType: 'json',
        success: function (data) {
			layer.msg(data.msg, {icon: data.icon});
            form.render();
            location.reload();
        },
        error: function () {
            layer.alert("保存配置执行异常!", {icon: 5});
        }
    });				  
    return false;	
  });
});

        $('.upload-img').hover(function (e){
            var e = window.event || e;
            var imgsrc = $(this).val();
            if(imgsrc.trim()==""){ return; }
            var left = e.clientX+document.body.scrollLeft+20;
            var top = e.clientY+document.body.scrollTop+20;
            $(".showpic").css({left:left,top:top,display:""});
            $(".showpic_img").attr("src", imgsrc);
        },function (e){
            $(".showpic").css("display","none");
        });
</script>
</body>
</html>